import request from '@/router/axios';

export const getList = (current, size, params) => {
  return request({
    url: '/api/rb-oem/oem/shopRefund/shop_refund/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

//退款订单统计
export const refundStatistics = (params) => {
  return request({
    url: '/api/rb-oem/oem/shopRefund/shop_refund/refundStatistics',
    method: 'get',
    params: {
      ...params
    }
  })
}

//查询未审核退款订单列表
export const ShopRefundUnapprovedList = (current, size, params) => {
  return request({
    url: '/api/rb-oem/oem/shopRefund/shop_refund/ShopRefundUnapprovedList',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}
//查询已审核退款订单列表
export const ShopRefundReviewedList = (current, size, params) => {
  return request({
    url: '/api/rb-oem/oem/shopRefund/shop_refund/ShopRefundReviewedList',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

export const getDetail = (id) => {
  return request({
    url: '/api/rb-oem/oem/shopRefund/shop_refund/detail',
    method: 'get',
    params: {
      id
    }
  })
}

//连表查得到退款订单详情
export const detailRefundById = (id) => {
  return request({
    url: '/api/rb-oem/oem/shopRefund/shop_refund/detailRefundById',
    method: 'get',
    params: {
      id
    }
  })
}
export const remove = (ids) => {
  return request({
    url: '/api/rb-oem/oem/shopRefund/shop_refund/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}


export const add = (row) => {
  return request({
    url: '/api/rb-oem/oem/shopRefund/shop_refund/submit',
    method: 'post',
    data: row
  })
}

//添加退款订单
export const addRefund = (row) => {
  return request({
    url: '/api/rb-oem/oem/shopRefund/shop_refund/addRefund',
    method: 'post',
    data: row
  })
}

export const update = (row) => {
  return request({
    url: '/api/rb-oem/oem/shopRefund/shop_refund/update',
    method: 'post',
    data: row
  })
}

// 导出未审核数据
export const exportRefundUnapproved = (params) => {
  return request({
    headers: {
      "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
    },
    responseType: 'blob',
    url: '/api/rb-oem/oem/shopRefund/shop_refund//exportRefundUnapproved',
    method: 'get',
    params: {
      ...params,
    }
  })
}

// 导出已审核数据
export const exportRefundReviewed = (params) => {
  return request({
    headers: {
      "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
    },
    responseType: 'blob',
    url: '/api/rb-oem/oem/shopRefund/shop_refund/exportRefundReviewed',
    method: 'get',
    params: {
      ...params,
    }
  })
}